package com.kly.sc.api.application.controller.user.request;

import com.fqgj.common.api.ParamsObject;
import com.kly.sc.api.infras.enums.RestCodeEnum;
import com.kly.sc.api.infras.exception.ApplicationException;
import org.apache.commons.lang3.StringUtils;
import java.util.Objects;

/**
 * 增加用户行为请求类
 * @author linqu
 */
public class AddBehaviorRequest extends ParamsObject {

    /**
     * 被操作用户
     */
    private String userCodeOperated;
    /**
     * 操作类型：1-首页照片浏览
     */
    private Integer actionType;
    /**
     * 结果：1-pass
     */
    private Integer resultType;
    /**
     * 操作详情
     */
    private String actionDetail;

    public String getUserCodeOperated() {
        return userCodeOperated;
    }

    public void setUserCodeOperated(String userCodeOperated) {
        this.userCodeOperated = userCodeOperated;
    }

    public Integer getActionType() {
        return actionType;
    }

    public void setActionType(Integer actionType) {
        this.actionType = actionType;
    }

    public Integer getResultType() {
        return resultType;
    }

    public void setResultType(Integer resultType) {
        this.resultType = resultType;
    }

    public String getActionDetail() {
        return actionDetail;
    }

    public void setActionDetail(String actionDetail) {
        this.actionDetail = actionDetail;
    }

    @Override
    public void validate() {

        if (Objects.isNull(this.actionType)) {
            throw new ApplicationException("The actionType should not be empty!");
        }

    }
}
